<?php
/**
 * Pipahr
 *
 * @author Randy Zhao
 * @copyright 2013 pipahr.com
 */
defined('_JEXEC') or die;

// disable core styles to avoid bs conflict
OC_Util::$core_styles = array();

if (isDevMode()) {
   OCP\Util::addStyle('interview', 'interview');
   OCP\Util::addScript('interview', 'home');
} else {
   OCP\Util::addStyle('static', 'interview');
   OCP\Util::addScript('static', 'apps/interview.home.min');
}

$lang = PFactory::getLanguage();
$lang->load("com_jobs", JPATH_SITE, "zh-CN");
$config = PFactory::getConfig();
$supportmail = $config->get('mailfrom','');

$company_url = PInterviewHelper::getCompanyUrl($_['basicInfo']->sub_domain,0);
$company_url = $company_url ? $company_url."?utp=nocp" : '';
?>
<script type="text/javascript" src="<?php print_unescaped(OC_Helper::linkTo('interview/js', 'interview.php'));?>"></script>
<div class="row-fluid">
   <div class="span12">
      <div class="company_info_box clearfix">
         <div class="company_showimg pull-left">
            <?php if (!empty($company_url)) : ?>
            <a href="<?=$company_url?>" target="_blank">
               <img src="<?php echo PCompanyHelper::showCompanyAvatar($_['basicInfo']->avatar, $_['basicInfo']->avatarapproved);?>" class="cpy_logo_mid"/>
            </a>
            <?php else : ?>
            <img src="<?php echo PCompanyHelper::showCompanyAvatar($_['basicInfo']->avatar, $_['basicInfo']->avatarapproved);?>" class="cpy_logo_mid"/>
            <?php endif;?>
         </div>
         <div class="company_showinfo">
            <h4 class="yahei">
               <?php if (!empty($company_url)) : ?>
               <a href="<?=$company_url?>" target="_blank"><?=$_['basicInfo']->comp_name?></a>
               <?php else : ?>
               <?=$_['basicInfo']->comp_name?>
               <?php endif;?>
               <i class="<?php echo $_['basicInfo']->validated == EMPLOYER_VALIDATED ? "is_approve" : "not_approve";?>"></i>
            </h4>
            <ul class="company_listinfo medium">
               <li>行业：<?php echo $_['basicInfo']->industry ? JText::_($_['basicInfo']->industry) : '未填写';?></li>
               <li>性质：<?php echo $_['basicInfo']->comp_type ? JText::_($_['basicInfo']->comp_type) : '未填写';?></li>
               <li>规模：<?php echo $_['basicInfo']->size_type ? JText::_($_['basicInfo']->size_type) : '未填写';?></li>
               <li>所在地区：<?php echo !empty($_['basicInfo']->cstate) || !empty($_['basicInfo']->ccity) ? $_['basicInfo']->cstate.$_['basicInfo']->ccity : "未填写";?></li>
            </ul>
         </div>
      </div>
   </div>
</div>

<div class="container">
   <div class="row-fluid">
      <div class="span12 blackbottom">
         <div class="company_position_show clearfix">
            招聘职位：<?php echo $_['basicInfo']->job_title ? $_['basicInfo']->job_title : '未填写';?> |
            工作城市：<?php echo ($_['basicInfo']->state || $_['basicInfo']->city) ? ($_['basicInfo']->state == $_['basicInfo']->city ? $_['basicInfo']->state : $_['basicInfo']->state.' '.$_['basicInfo']->city) : '未填写'; ?> |
            薪水：<?php echo $_['basicInfo']->salary_type ? $_['basicInfo']->salary_type : '未填写';?> |
            经验：<?php echo $_['basicInfo']->exp_name ? JText::_($_['basicInfo']->exp_name) : '未填写';?> |
            招聘人数：<?php echo $_['basicInfo']->num_needed ? $_['basicInfo']->num_needed : '未填写';?>
         </div>
      </div>
   </div>
</div>

<div class="container">
   <div class="row-fluid">
      <div class="span12">
         <div class="company_qes_fixed large clearfix"><?=$_['basicInfo']->job_title;?>职位线上竞聘</div>
      </div>
   </div>
</div>

<div class="row-fluid hr_oneconn_margin">
   <div class="span12 oneconn_box">
      <div class="lgrg_form">
         <div class="hr_inputinfo">
            <?php 
            $sources = explode(",", $_['basicInfo']->source);
            $sourcesname = "";
            if(count($sources) > 1) {
               $sourcesname = '前程无忧和智联招聘';
            }
            else if(in_array('51job', $sources)) {
               $sourcesname = '前程无忧';
            }
            else if(in_array('zhilian', $sources)) {
               $sourcesname = '智联招聘';
            }
            else if(in_array('jiancai', $sources)) {
               $sourcesname = '建筑英才';
            }
            else if(in_array('upload', $sources)) {
               $sourcesname = '';
            }
            ?>
            <div class="hr_newstip"><span><?=$_['basicInfo']->jobseeker_name;?></span>，您好！<br/>
               <?php if(!empty($sourcesname)):?>
 您通过 <?=$sourcesname;?> 申请了<b><a href="<?=$company_url?>"><?=$_['basicInfo']->comp_name;?></a></b> 的 <b><?=$_['basicInfo']->job_title;?></b> 职位，
               <?php else:?>
               <b><a href="<?=$company_url?>"><?=$_['basicInfo']->comp_name;?></a></b> 诚邀您完成 <b><?=$_['basicInfo']->job_title;?></b> 的线上竞聘流程，
               <?php endif;?>
               您需要尽快完成线上竞聘流程。
               <br>如有疑问，欢迎您发送邮件至 <b><a href="mailto:<?=$supportmail?>" style="color: #076C9B; text-decoration:none;"><?=$supportmail?></a></b> 或致电客服热线：<b>4006-747247</b>。如您放弃，您将失去获得该职位的宝贵机会。</div>
            <div class="hr_teststep">
               <table width="100%" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                     <td width="" class="medium test_ok"><span class="teststep_1"><i></i>核对身份</span></td>
                     <td width="22" class="arrow_blue_grey"></td>
                     <td width="" class="medium"><span class="teststep_2"><i></i>完善信息</span></td>
                     <?php if ($_['isPaperSet'] && $_['isInviteToken']) :?>
                     <td width="22" class="arrow_grey_grey"></td>
                     <td width="" class="medium"><span class="teststep_3"><i></i>线上笔试</span></td>
                     <?php endif;?>
                     <td width="22" class="arrow_grey_grey"></td>
                     <td width="" class="medium"><span class="teststep_4"><i></i>完成&nbsp;&nbsp;&nbsp;</span></td>
                  </tr>
               </table>
            </div>
            <div class="hr_testerinfo_input">
               <p><span class="yellowcolor">请验证您在投递简历时留下的联系方式</span><br/><span class="medium">仅用于身份验证，我们保证不会泄露您的个人信息</span></p>
               <div class="hr_testinfo_form">
                  <form action="<?php echo OC_Helper::linkToRoute("interview_verifytoken");?>" method="post" name="verifytokenform" id="verifytokenform">
                     <div class="hr_form_group clearfix">
                        <label class="hr_name_label" for="inputPhone">手机号码：</label>
                        <div class="hr_controls">
                           <input type="text" name="phone" id="phone" placeholder=""/>
                           <?php if (!empty($_['basicInfo']->jobseeker_phone)) :?>
                           <div class="jobseekerinfo songti"><?php echo starPhone($_['basicInfo']->jobseeker_phone);?></div>
                           <?php endif;?>
                        </div>
                     </div>
                     <div class="hr_form_group clearfix">
                        <label class="hr_name_label" for="inputEmail">邮&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;箱：</label>
                        <div class="hr_controls">
                           <input type="text" name="email" id="email" placeholder=""/>
                           <?php if (!empty($_['basicInfo']->jobseeker_email) && !isFakeEmail($_['basicInfo']->jobseeker_email)) :?>
                           <div class="jobseekerinfo songti"><?php echo starEmail($_['basicInfo']->jobseeker_email);?></div>
                           <?php endif;?>
                        </div>
                     </div>
                     <?php if(!isDevMode()  && (empty($_['basicInfo']->jobseeker_email) || isFakeEmail($_['basicInfo']->jobseeker_email))): ?>
                     <div class="hr_form_group clearfix" id='reg_vcode' style='margin-top:27px;'>
                      <label class="hr_name_label" for="vcode">邮箱验证码：</label>
                      <div class="hr_controls">
                         <input type="text" class="inputbox large required" style='width: 130px' id="vcode" name="vcode" maxlength="6">
                         <label><a class="button" style="width:130px;" id="reg_getvcode" href="javascript:;"><span style="color:#005d78;">获取邮箱验证码</span></a></label>
                         <label for="vcode" class="error" derror="请输入邮箱验证码" style="display:none">请输入邮箱验证码</label>
                       </div>
                     </div>
                     <?php endif;?>
                     <div class="hr_form_group clearfix" style='margin-top:27px;'>
                        <div class="hr_controls">
                           <input class="ppp_bluebtn" type="submit" value="提 交" id="verify_submit" disabled="disabled"/>
                           <input type="hidden" name="token" value="<?=$_['token']?>"/>
                           <input type="hidden" name="requesttoken" value="<?php echo $_['requesttoken'] ?>" id="requesttoken">
                           <br/><span id='errormsg' class='error' style='color:red; display:none;'></span>
                        </div>
                     </div>
                  </form>

               </div>
            </div>
         </div>
      </div>
   </div>
</div>

